package com.zygh.policeasset.controller;

import com.github.pagehelper.PageInfo;
import com.zygh.policeasset.component.CommonResult;
import com.zygh.policeasset.pojo.VisualSettings;
import com.zygh.policeasset.service.VisualSettingsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = {"APP可视化设置表"})
@RequestMapping({"visualSettings"})
@RestController
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/controller/VisualSettingsController.class */
public class VisualSettingsController {
    @Resource
    VisualSettingsService visualSettingsService;

    @GetMapping({"selectOne"})
    @ApiOperation("通过ID查询")
    public VisualSettings selectOne(Integer id) {
        return this.visualSettingsService.queryById(id);
    }

    @GetMapping({"queryAll"})
    @ApiOperation("分页查询全部")
    public PageInfo queryAll(@RequestParam(defaultValue = "1", value = "pageNum") Integer pageNum, @RequestParam(defaultValue = "10", value = "pageSize") Integer pageSize, VisualSettings visualSettings) {
        return this.visualSettingsService.queryAll(pageNum.intValue(), pageSize.intValue(), visualSettings);
    }

    @PostMapping({"insert"})
    @ApiOperation("添加")
    public CommonResult insert(@RequestBody VisualSettings visualSettings) {
        return this.visualSettingsService.insert(visualSettings);
    }

    @PutMapping({"update"})
    @ApiOperation("修改")
    public CommonResult update(@RequestBody VisualSettings visualSettings) {
        return this.visualSettingsService.update(visualSettings);
    }

    @DeleteMapping({"/delete/{id}"})
    @ApiOperation("根据id删除")
    public CommonResult delete(@PathVariable Integer id) {
        return this.visualSettingsService.deleteById(id);
    }
}